package ontime

import org.apache.flink.streaming.api.scala._

/**
  * @author dinghao 
  * @create 2021-07-27 18:02 
  * @message
  */
object Ncflink {
  def main(args: Array[String]): Unit = { //ncip filterword
    val env = StreamExecutionEnvironment.getExecutionEnvironment
    val data:DataStream[String] = env.socketTextStream(args(0),9999)
    data.flatMap(_.split(" ")).map((_,1)).filter(_._1 != args(1)).keyBy(_._1).reduce((s1,s2)=>(s1._1,s1._2+s2._2)).print()
    env.execute("ncflink")
  }
}
